package com.jackeys.piaems.dto;

import com.jackeys.piaems.entity.User;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.zip.Inflater;

/**
 * @ClassName: UserInfDto
 * @Description: 用户信息数据传输类
 * @Author: Jackeys
 * @Date: 2021-06-16 21:41
 * @Version: 1.0
 */

@Data
public class UserInfDto implements Serializable {
    /**
     * id
     */
    private Long id;
    /**
     * 姓名
     */
    private String name;
    /**
     * 账号
     */
    private String account;
    /**
     * 密码
     */
    private String password;
    /**
     * 账号
     */
    private String email;
    /**
     * 电话
     */
    private String phone;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 生日
     */
    private Date birthday;
    /**
     * 性别
     */
    private String sex;
    /**
     * 签名
     */
    private String sign;
    /**
     * 头像
     */
    private String headPortrait;

    public UserInfDto() {
    }

    private UserInfDto(Builder builder) {
        this.id = builder.id;
        this.name = builder.name;
        this.account = builder.account;
        this.password=builder.password;
        this.email=builder.email;
        this.phone=builder.phone;
        this.age = builder.age;
        this.birthday=builder.birthday;
        this.sex=builder.sex;
        this.sign=builder.sign;
        this.headPortrait=builder.headPortrait;
    }

    /**
     * 构建者模式构建对象
     */
    public static final class Builder {

        private Long id;
        private String name;
        private String account;
        private String password;
        private String email;
        private String phone;
        private Integer age;
        private Date birthday;
        private String sex;
        private String sign;
        private String headPortrait;

        public Builder id(Long id) {
            this.id = id;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder account(String account) {
            this.account = account;
            return this;
        }

        public Builder password(String password) {
            this.password = password;
            return this;
        }
        public Builder email(String email) {
            this.email = email;
            return this;
        }

        public Builder phone(String phone) {
            this.phone = phone;
            return this;
        }

        public Builder age(Integer age) {
            this.age = age;
            return this;
        }

        public Builder birthday(Date birthday) {
            this.birthday = birthday;
            return this;
        }

        public Builder sex(String sex){
            this.sex=sex;
            return this;
        }
        public Builder sign(String sign) {
            this.sign = sign;
            return this;
        }

        public Builder headPortrait(String headPortrait) {
            this.headPortrait = headPortrait;
            return this;
        }

        //使用构建者创建UserInfDto对象
        public UserInfDto build() {
            return new UserInfDto(this);
        }
    }
}
